#include<stdio.h>

int main()
{
	int n,i,j,m,flag;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		flag=0;
		scanf("%d",&m);
		for (j=2;j<=m;j+=2)
			if (m%j==0)
			{
				flag=1;
				printf("%d ",j);
			}
		if (flag==1)
			printf("\n");
		else
			printf("%d has no even factors\n",m);
	}
	return 0;
}
